<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>单行文本溢出替换为省略号</title>
    <style>
        div {
            background-color: yellow;
            /* 限制父元素的宽度 否则文字会根据屏幕大小换行 不会溢出 */
            width: 200px;
            /* 强制文本不换行 */
            white-space: nowrap;
            /* 溢出隐藏 多于文本直接裁掉 */
            overflow: hidden;
            /* 溢出的文字替换为省略号 */
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci alias at blanditiis dolores, exercitationem facilis iusto magnam maxime necessitatibus neque non pariatur perspiciatis repellendus tempore totam unde veniam voluptate voluptatem.</div>
</body>
</html>